<?php

class ContactForm extends BaseForm
{
  public function configure()
  {
    $this->setWidgets(array(
      'name' => new sfWidgetFormInputText(),
      'email' => new sfWidgetFormInputText(),
      'subject' => new sfWidgetFormInputText(),
      'message' => new sfWidgetFormTextarea()
    ));
    
    $this->setValidators(array(
      'name' => new sfValidatorString(),
      'email' => new sfValidatorEmail(array(), array('invalid' => 'Invalid email.')),
      'subject' => new sfValidatorString(),
      'message' => new sfValidatorString(array('min_length' => 20))
    ));
    
    $this->widgetSchema->setNameFormat('contact[%s]');
  }
}